import { createI18n } from "vue-i18n"
import en from "./en.ts"
import zh from "./zh.ts"

import { useLanguage } from "@/store/language.ts"
// const langStore = useLanguage()
// console.log(langStore.language)
const messages = {
    en,
    zh
}
const i18n = createI18n({
    legacy: false,
    locale: JSON.parse(localStorage.getItem('language') as string).language ?? 'zh',
    globalInjection: true,
    messages
})
export default i18n